

#include "GraphicsObject.h"

//Primary constructor
GraphicsObject::GraphicsObject(int id):BaseEntity(id)
{
    cout << "\nObject Constructed";
    
    mObjectPos.x_Pos = 0.0;
    mObjectPos.y_Pos = 0.0;
    mObjectPos.z_Pos = 0.0;
    
    mObjectRot.x_Rot = 0.0;
    mObjectRot.y_Rot = 0.0;
    mObjectRot.z_Rot = 0.0;
    
    mObjectScl.x_Scl = 1.0;
    mObjectScl.y_Scl = 1.0;
    mObjectScl.z_Scl = 1.0;
}

//Overloaded constructor to support the game objects position
GraphicsObject::GraphicsObject(int id, double xPos, double yPos, double zPos):BaseEntity(id)
{
    cout << "\nOverloaded Constructor";

    //Assign the objects position based on the constructor
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
    mObjectRot.x_Rot = 0.0;
    mObjectRot.y_Rot = 0.0;
    mObjectRot.z_Rot = 0.0;
    
    mObjectScl.x_Scl = 1.0;
    mObjectScl.y_Scl = 1.0;
    mObjectScl.z_Scl = 1.0;
}

//Overloaded constructor to support the game objects position, and object type
GraphicsObject::GraphicsObject(int id, ObjectType objType, double xPos, double yPos, double zPos):BaseEntity(id)
{
    cout << "\nSecond Overloaded Constructor";
    
    mObjType = objType;
    
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
    mObjectRot.x_Rot = 0.0;
    mObjectRot.y_Rot = 0.0;
    mObjectRot.z_Rot = 0.0;
    
    mObjectScl.x_Scl = 1.0;
    mObjectScl.y_Scl = 1.0;
    mObjectScl.z_Scl = 1.0;
}

//Overloaded constructor to support the game objects position, object type, and rotation information
GraphicsObject::GraphicsObject(int id, ObjectType objType, double xPos, double yPos, double zPos, double xRot, double yRot, double zRot):BaseEntity(id)
{
    cout << "\nThird Overloaded Constructor";
    
    mObjType = objType;
    
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
    mObjectRot.x_Rot = xRot;
    mObjectRot.y_Rot = yRot;
    mObjectRot.z_Rot = zRot;
    
    mObjectScl.x_Scl = 1.0;
    mObjectScl.y_Scl = 1.0;
    mObjectScl.z_Scl = 1.0;
}

//Overloaded constructor to support the game objects position, object type, rotation information, and scale information
GraphicsObject::GraphicsObject(int id, ObjectType objType, double xPos, double yPos, double zPos, double xRot, double yRot, double zRot, double xScl, double yScl, double zScl):BaseEntity(id)
{
    cout << "\nFourth Overloaded Constructor";
    
    mObjType = objType;
    
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
    mObjectRot.x_Rot = xRot;
    mObjectRot.y_Rot = yRot;
    mObjectRot.z_Rot = zRot;
    
    mObjectScl.x_Scl = xScl;
    mObjectScl.y_Scl = yScl;
    mObjectScl.z_Scl = zScl;
}

//Update function
void GraphicsObject::Update()
{
    cout << "\nUpdate called";
}

//Setter for object position
void GraphicsObject::setObjectPosition(double xPos, double yPos, double zPos)
{
    mObjectPos.x_Pos = xPos;
    mObjectPos.y_Pos = yPos;
    mObjectPos.z_Pos = zPos;
    
}

//Overloaded setter for object position that accepts a Position3D object
void GraphicsObject::setObjectPosition(Position3D position)
{
    mObjectPos.x_Pos = position.x_Pos;
    mObjectPos.y_Pos = position.y_Pos;
    mObjectPos.z_Pos = position.z_Pos;
}

//Setter for object rotation
void GraphicsObject::setObjectRotation(double xRot, double yRot, double zRot)
{
    mObjectRot.x_Rot = xRot;
    mObjectRot.y_Rot = yRot;
    mObjectRot.z_Rot = zRot;
}

//Overloaded setter for object position that accepts a Rotation3D object
void GraphicsObject::setObjectRotation(Rotation3D rotation)
{
    mObjectRot.x_Rot = rotation.x_Rot;
    mObjectRot.y_Rot = rotation.y_Rot;
    mObjectRot.z_Rot = rotation.z_Rot;
}

//Setter for object scale
void GraphicsObject::setObjectScale(double xScl, double yScl, double zScl)
{
    mObjectScl.x_Scl = xScl;
    mObjectScl.y_Scl = yScl;
    mObjectScl.z_Scl = zScl;
}

//Overloaded setter for object position that accepts a Scale3D object
void GraphicsObject::setObjectScale(Scale3D scale)
{
    mObjectScl.x_Scl = scale.x_Scl;
    mObjectScl.y_Scl = scale.y_Scl;
    mObjectScl.z_Scl = scale.z_Scl;
}

//Getter for object position
Position3D GraphicsObject::getObjectPosition()
{
    return mObjectPos;
}

//Getter to return positions of X, Y, and Z axis respectively
double GraphicsObject::getObjectPositionX(){return mObjectPos.x_Pos;}
double GraphicsObject::getObjectPositionY(){return mObjectPos.y_Pos;}
double GraphicsObject::getObjectPositionZ(){return mObjectPos.z_Pos;}

//Getter for object rotation
Rotation3D GraphicsObject::getObjectRotation()
{
    return mObjectRot;
}

//Getter to return rotations of X, Y, and Z axis respectively
double GraphicsObject::getObjectRotationX(){return mObjectRot.x_Rot;};
double GraphicsObject::getObjectRotationY(){return mObjectRot.y_Rot;};
double GraphicsObject::getObjectRotationZ(){return mObjectRot.z_Rot;};

//Getter for object scale
Scale3D GraphicsObject::getObjectScale()
{
    return mObjectScl;
}

//Getter to return scale factors of X, Y, and Z axis respectively
double GraphicsObject::getObjectScaleX(){return mObjectScl.x_Scl;};
double GraphicsObject::getObjectScaleY(){return mObjectScl.y_Scl;};
double GraphicsObject::getObjectScaleZ(){return mObjectScl.z_Scl;};

//Draw graphics object
void GraphicsObject::drawObject(ObjectType objType)
{
    
     switch (objType)
     {
         case PYRAMID:
             drawPyramid();
             break;
     
         case CUBE:
             drawCube();
             break;
             
         default:
             break;
     }
    
}

//Setter for object type
void GraphicsObject::setObjectType(ObjectType objType)
{
    mObjType = objType;
}

//Getter for object type
ObjectType  GraphicsObject::getObjectType()
{
    return mObjType;
}

